export const httpRes = (options) => {
	return new Promise( (resolve,reject) => {
		uni.request({
			url:'http://localhost:8082/'+ options.url,
			method: options.method || 'GET',
			data: options.data || {},
			success: (res) => {
				if(res.data.status !== 0){
					console.log(res)
					return uni.showToast({
						title: '获取数据失败',
						duration: 1500
					});
				}
				resolve(res)
			},
			fail:(err) => {
				return uni.showToast({
					title: '请求接口失败',
					duration: 1500
				});
				reject(err)
			}
		})
	})
}